//
//  MainMenuViewController.m
//  Care With Friends
//
//  Created by Versatile Systems, Inc on 11/5/13.
//  Copyright (c) 2013 Muludiang. All rights reserved.
//

#import "MainMenuViewController.h"
#import "CWFData.h"


@interface MainMenuViewController ()

@end

@implementation MainMenuViewController

@synthesize mainSearchBar;
@synthesize userNameLabel;
@synthesize discoverBtn, addBtn, updatesBtn, nextBtn;

-(IBAction)hideKeyboard:(id)sender{
    [mainSearchBar resignFirstResponder];

}


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    UIImage *buttonImage = [[UIImage imageNamed:@"blackButton.png"]
                            resizableImageWithCapInsets:UIEdgeInsetsMake(18, 18, 18, 18)];
    UIImage *buttonImageHighlight = [[UIImage imageNamed:@"blackButtonHighlight.png"]
                                     resizableImageWithCapInsets:UIEdgeInsetsMake(18, 18, 18, 18)];
    // Set the background for any states you plan to use
    //UIButton *tempBtn =[UIButton buttonWithType:UIButtonTypeCustom];
    [discoverBtn setBackgroundImage:buttonImage forState:UIControlStateNormal];
    [discoverBtn setBackgroundImage:buttonImageHighlight forState:UIControlStateHighlighted];
    [addBtn setBackgroundImage:buttonImage forState:UIControlStateNormal];
    [addBtn setBackgroundImage:buttonImageHighlight forState:UIControlStateHighlighted];
    [updatesBtn setBackgroundImage:buttonImage forState:UIControlStateNormal];
    [updatesBtn setBackgroundImage:buttonImageHighlight forState:UIControlStateHighlighted];
    [nextBtn setBackgroundImage:buttonImage forState:UIControlStateNormal];
    [nextBtn setBackgroundImage:buttonImageHighlight forState:UIControlStateHighlighted];
    
    CWFData *dataObj = [CWFData sharedInstance];
   // NSLog(@"=====>User details: %@", [dataObj.getUserDetail valueForKey:@"user"]);
    //NSDictionary  *t1 = [[NSDictionary alloc] initWithDictionary:[dataObj.getUserDetail valueForKey:@"user"] copyItems:YES];

    userNameLabel.text = [NSString stringWithFormat:@"@%@",[[dataObj.getUserDetail valueForKey:@"user"] valueForKey:@"username"]];
    
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
